package com.dog.basics.api.controller.common;


import com.dog.basics.bean.dto.admin.common.GuidePageFromDto;
import com.dog.basics.bean.vo.admin.common.GuidePageVo;
import com.dog.basics.bean.vo.api.common.ApiGuidePageVo;
import com.dog.basics.common.constant.SwaggerConstants;
import com.dog.basics.common.util.R;
import com.dog.basics.service.common.IDogGuidePageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 引导页和启动页 前端控制器
 * </p>
 *
 * @author wph
 * @since 2020-05-27
 */
@RestController
@RequestMapping("/api/guide/page")
@Api(value = "引导页和启动页", tags = SwaggerConstants.API_ALL)
@AllArgsConstructor
public class DogGuidePageController {
    private final IDogGuidePageService dogGuidePageService;

    /**
     * @Description: 引导页和启动页列表
     * @Param: status
     * @return: IPage<GuidePageVo>
     * @Author: wph
     * @Date:
     */
    @ApiOperation(value = "引导页和启动页列表", tags = SwaggerConstants.API_UTIL)
    @ApiImplicitParam(name = "type", value = "类型0:引导页  1:启动页", required = true, dataType = "Integer")
    @GetMapping("/page")
    public R<List<ApiGuidePageVo>> page(GuidePageFromDto dto) {
        return R.ok(dogGuidePageService.getApiList(dto));
    }

}
